<%@ page import="java.net.URLDecoder" %>
<%@ page import="giit.computerbase.util.DealWithCharcter" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <title>提示信息</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/signin.css" rel="stylesheet">

</head>

<body>
<%
    String title = request.getParameter("title");
    String state = request.getParameter("state");
    String context = request.getParameter("context");
    String preview = request.getParameter("preview");
    if (title != null && state != null && context != null && preview != null) {
        title = URLDecoder.decode(title, "utf-8");
        state = URLDecoder.decode(state, "utf-8");
        context = URLDecoder.decode(context, "utf-8");
        preview = URLDecoder.decode(preview, "utf-8");

        title = DealWithCharcter.dealWith(title);
        state = DealWithCharcter.dealWith(state);
        context = DealWithCharcter.dealWith(context);
        preview = DealWithCharcter.dealWith(preview);
    }
%>
<!-- page header start-->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index">主页</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <%
                    String user = (String) request.getSession().getAttribute("user");
                    if (user == null || user.equals("")) {
                %>
                <li><a href="login.jsp">登录</a></li>
                <li><a href="register.jsp">注册</a></li>
                <%
                } else {
                %>
                <li><a href=""><%=request.getSession().getAttribute("user")%>
                </a></li>
                <li><a href="edit.jsp">发新闻稿</a></li>
                <%
                    if ((boolean) request.getSession().getAttribute("manager")) {
                %>
                <li><a href="manager.jsp">管理</a></li>
                <%
                    }
                %>
                <li><a href="logout">退出</a></li>
                <%
                    }
                %>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>
<!-- page header end-->


<div class="container"><br><br>

    <div class="row">
        <div class="panel <%=state%>  col-sm-offset-3 col-xs-offset-2 col-md-offset-3 col-xs-8 col-sm-6 col-md-6">
            <div class="panel-heading" style="text-align: center"><%=title%>
            </div>

            <div class="panel-body">
                <p style="font-size:20px;text-align: center" ;><%=context%>
                </p>
                <a class="btn btn-primary pull-right" href="<%=preview%>">返回</a>
            </div>
        </div>
    </div>

</div> <!-- /container -->

<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
